package br.great.clientServer;

import java.util.Vector;
import br.great.classes.TradeText;
import br.great.DAO.DAO_ContentAnnotationHasTag;
import br.great.DAO.DAO_InvertedIndex;
import br.great.DAO.DAO_InvertedIndexHasPhoto;
import br.great.DAO.DAO_TAG;
import br.great.beans.InvertedIndex;
import br.great.beans.Tag;

/**
 * PhotoMap
 * Copyright (c) 2007-2008 STEAMER - LIG, All rights reserved.
 */
/**
 * @author Developpement of PhotoMap
 */
public class TagAndInvertedIndexInsert {

    /** method description
     * @param var signification
     * @exception exception class name
     * @return return_value return signification
     * @see package.class#member label
     */
  /*  public void tagInsert(int iCA, String tag, String tagType, double weight) {
        DAO_ContentAnnotationHasTag dcah = DAO_ContentAnnotationHasTag.getInstance();
        DAO_TAG dt = DAO_TAG.getInstance();
        Tag t = new Tag();
        Vector<String> vs = TradeText.stringToVectorStringBySpaceForTag(tag);
        for (int i = 0; i < vs.size(); i++) {
            String tagValue = vs.get(i);
            tagValue = TradeText.tradeText(tagValue);
            tagValue = TradeText.changeFirstLetter(tagValue);

            if (tagValue != null) {
                t.setTAG_VALUE(tagValue);
                t.setTAG_TYPE(tagType);
                t.setTAG_ID(dt.insertTAG(t));
                dcah.insertContentAnnotationHasTag(t.getTAG_ID(), iCA, weight);
            }
        }
    }

    public void invertedIndexInsert(int idMultimedia, String invertedIndex, String tagType, double weight, String stamp) {
        DAO_InvertedIndexHasPhoto diihp = DAO_InvertedIndexHasPhoto.getInstance();
        DAO_InvertedIndex dii = DAO_InvertedIndex.getInstance();
        InvertedIndex iv = new InvertedIndex();
        Vector<String> vs = TradeText.stringToVectorStringBySpaceForTag(invertedIndex);
        for (int i = 0; i < vs.size(); i++) {
            String tagValue = vs.get(i);
            tagValue = TradeText.tradeText(tagValue);
            tagValue = TradeText.changeFirstLetter(tagValue);

            if (tagValue != null) {
                iv.setTAG_VALUE(tagValue);
                iv.setTAG_TYPE(tagType);
                iv.setTAG_ID(dii.insertInvertedIndex(iv, stamp));
                diihp.insertInvertedIndexPhoto(iv.getTAG_ID(), idMultimedia, weight);
            }
        }
    }
   * */
}
